home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / byte0787.arc / IWPAS.ARC / VIDEMO.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1987-04-28  |  2.5 KB  |  93 lines

  1. PROGRAM Demo(input,output,picfile);
  2.  
  3. { Copyright (c) 1987, Ciarcia's Circuit Cellar          }
  4. {    All Rights Reserved                                }
  5.  
  6. {$U- control-break checking during execution            }
  7. {$C- control-break checking during I/O operations       }
  8. {$R- array range checking                               }
  9.  
  10. {$Ideclares.p                   declarations            }
  11. {$Ihexutil.p                    hex utilities           }
  12. {$Iserial.p                     serial interface code   }
  13. {$Ipictures.p                   picture file code       }
  14. {$Iimages.p                     image processing        }
  15.  
  16. VAR
  17.  level      : INTEGER;          { delta threshold       }
  18.  changes    : REAL;             { # changed threshold   }
  19.  npels      : REAL;             { # actually changed    }
  20.  valerror   : INTEGER;          { error code from Val   }
  21.  picswap    : picptr;           { used to swap buffers  }
  22.  
  23. BEGIN
  24.  
  25.  LowVideo;
  26.  
  27.  ComOn(bitsec);                 { set up serial port    }
  28.  
  29.  pic0 := NIL;                   { get working buffer    }
  30.  PicSetup(pic0);
  31.  
  32.  pic1 := NIL;                   { get ref pic buffer    }
  33.  PicSetup(pic1);
  34.  SetSyncs(pic1);                {  ... and add controls }
  35.  
  36.  pic2 := NIL;                   { get test pic buffer   }
  37.  PicSetup(pic2);
  38.  SetSyncs(pic2);                {  ... and add controls }
  39.  
  40.  pic3 := NIL;                   { get changes buffer    }
  41.  PicSetup(pic3);
  42.  SetSyncs(pic3);                {  ... and add controls }
  43. (*
  44.  Writeln('Grabbing reference picture...');
  45.  GetPicture(pic0);
  46.  Writeln('  expanding');
  47.  Expand(pic0,pic3);
  48. *)
  49.  REPEAT
  50.  
  51.   Writeln('Capturing new image...');
  52.   GetPicture(pic0,fullres);     { grab test picture      }
  53.   Writeln('  displaying');
  54.   SendPicture(pic0);
  55.  
  56.   Writeln('  expanding');
  57.   Expand(pic0,pic1);
  58.  
  59.   IF KeyPressed
  60.    THEN Exit;
  61.  
  62.   Histogram(pic1,histo);
  63.   ShowHist(histo);
  64.  
  65.   Writeln('Finding outlines...');
  66.   Edge(pic1,pic2);
  67.   Writeln('  displaying');
  68.   SendPicture(pic2);
  69.   Writeln('  enhancing');
  70.   Multiply(pic2,3);
  71.   Writeln('  displaying');
  72.   SendPicture(pic2);
  73.  
  74.   IF KeyPressed
  75.    THEN Exit;
  76. (****
  77.   Writeln('Comparing with previous image...');
  78.   Compare(pic1,pic3,pic2);
  79.   Writeln('  displaying');
  80.   SendPicture(pic2);
  81.   Writeln('  enhancing');
  82.   Multiply(pic2,3);
  83.   Writeln('  displaying');
  84.   SendPicture(pic2);
  85. ***)
  86.   picswap := pic1;
  87.   pic1 := pic3;
  88.   pic3 := picswap;
  89.  
  90.  UNTIL KeyPressed;
  91.  
  92. END.
  93.